<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/website/common/base.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${webname }-采购模板</title>
<%@ include file="/website/common/common.jsp"%>
<link href="${webctx }/css/manage.css" rel="stylesheet" type="text/css" />
<style>
	.edit-inp{width:350px;}
	.edit-inp input{width:352px;}
	.edit-img span{display: block}
	.cart-checkbox{ position:relative; padding:10px 0 0 0px; overflow:hidden}
	.cart-checkbox input{ position:absolute; left:-20px;}
	.cart-checkbox label{ display:inline-block;cursor:pointer;}
	.cart-checkbox .chk-ico{ width:18px; height:17px;  display:inline-block; position:relative; top:4px; background:url(${webctx}/images/radio1.jpg) no-repeat}
	.checked .chk-ico{ background:url(${webctx}/images/radio2.jpg) no-repeat}
	.combo-text{color:#FF7B79;font-size:14px}
</style>
</head>

<body>
<%@ include file="/website/common/top.jsp"%>
<%@ include file="/website/common/head.jsp"%>
<%@ include file="/website/common/menu.jsp"%>

<div class="warp-body">
	<div class="inner clearfix">
    	<div class="left-main">
        	<div class="left-inner">
            	<%@ include file="/website/user/left.jsp"%>
            </div>
        </div>
    	<div class="right-main">
        	<div class="right-inner" style="background-color: #ffffff;position: relative;">
            	<div class="right-title"><span></span>采购模板</div>
            	<div style="position: absolute;right:14px;top:12px"><a href="javascript:window.history.back();" style="color:#0DBFFF;font-size:16px;"><label style="padding-right:4px;"><</label>返回</a></div>
            	<div class="ente-edit-info" style="height:550px;">
            		<div class="line8"></div>
            		<form action="" method="post" onsubmit="return false">
            		<input name="panid" type="hidden" value="${bean.id }">
            		
            		<ul>
            			<li class="edit-item">
                        	<div class="edit-inner">
                            	<div class="edit-title">提醒设置：</div>
                                <div class="edit-con">
                                	<div class="cart-checkbox">
			                            <input name="isremind" type="checkbox" value="1" <c:if test="${bean.isremind==1 }">checked</c:if>/>
			                            <label class="J_select">
			                            	<span class="chk-ico"></span> 开启提醒
			                            </label>
			                        </div>
                                </div>
                            </div>
                        </li>
                        <li class="edit-item">
                        	<div class="edit-inner">
                            	<div class="edit-title">提醒内容：</div>
                                <div class="edit-con" style="height:120px;padding-bottom:12px;">
									<textarea name="remindcon" style="border:1px solid #ececec;width:350px;height:130px;overflow-y:auto;resize:none;">${bean.remindcon }</textarea>
                               	</div>
                                
                            </div>
                        	
                        </li>
                        <li class="edit-item clear">
                        	<div class="edit-inner">
                            	<div class="edit-title">提醒设置：</div>
                                <div class="edit-con">
                                	<div class="cart-checkbox">
			                            <input name="isphone" type="checkbox" value="1" <c:if test="${bean.isphone==1 }">checked</c:if>/>
			                            <label class="J_select">
			                            	<span class="chk-ico"></span> 手机短信
			                            </label>
			                        </div>
                                </div>
                            </div>
                        </li>
                        <li class="edit-item">
                        	<div class="edit-inner">
                            	<div class="edit-title">接收手机：</div>
                                <div class="edit-con">
                                	<div class="edit-inp"><input type="text" name="remindphone" value="${bean.remindphone }"></div>
                                	<div class="tips"></div>
                                </div>
                            </div>
                        </li>
                        <li class="edit-item">
                        	<div class="edit-inner">
                            	<div class="edit-title">提醒时间：</div>
                                <div class="edit-con">
                                	<div class="edit-inp" style="border-width:0px"><input id="dated" type="text" name="reminddata" value="${bean.reminddata }" class="easyui-datetimebox" style="width:350px;height:36px;" data-options="showSeconds:false"></div>
                                	<div class="tips"></div>
                                </div>
                            </div>
                        </li>
                        <li class="edit-item clear">
                        	<div class="edit-inner">
                            	<div class="edit-title">重复提醒：</div>
                                <div class="edit-con">
                                	<div class="cart-checkbox" style="float:left">
			                            <input name="remindrepeat" type="checkbox" value="1" <c:if test="${bean.remindrepeat==1 }">checked</c:if>/>
			                            <label class="J_select">
			                            	<span class="chk-ico"></span> 开启
			                            </label>
			                            
			                        </div>
			                        <label style="margin-left:30px;float:left;margin-top:6px;">
			                           	 每<input name="repeatday" value="${bean.repeatday }"  style="width:40px;height:28px;border:1px solid #ececec;margin:0 4px">天重复提醒我
			                         </label>
                                </div>
                            </div>
                        </li>
                        <li class="edit-item clear">
                        	<div class="edit-inner">
                            	<div class="edit-title">&nbsp;</div>
                                <div class="edit-con edit-papers-btn">
                                	
                                		<button onclick="tosubmit()" style=" margin-left:0px;margin-top:10px;">保存设置</button>
                                		
                                </div>
                            </div>
                        </li>
            		</ul>
            		<div class="clear"></div>
            		</form>
            	</div>
            </div>
        </div>
    </div>
</div>

<%@ include file="/website/common/foot.jsp"%>

<link type="text/css" rel="stylesheet" href="${webctx }/css/webeasyui.css">
<script type="text/javascript" src="${ctx }/util/js/easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx }/util/js/easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>

</body>
</html>
<script>
var uploader;
$(function(){
	setLeftCur("cgmb");
	
	$('.J_select').each(function(){
		if($(this).prev().get(0).checked)
			$(this).parent().addClass('checked');
	})

	$('.J_select').click(function(){
		var ischeck=false;
		if($(this).parent().get(0).className.indexOf("checked")==-1)ischeck=true;
		checkbox($(this).parent(),ischeck);
	})
})
function checkbox(obj,ischeck){
	if(ischeck){
		if(obj.get(0).className.indexOf("checked")==-1){
			obj.addClass("checked");
		}
	}else obj.removeClass("checked");
	$("[type='checkbox']",obj).get(0).checked=ischeck;
	
}
var subing=false;
function tosubmit(){
	if($("[name='isphone']").get(0).checked && $("[name='remindphone']").val()==''){
		alert("请输入手机号");
		return false;
	}
	if($("[name='remindphone']").val()!="" && !$w.isMobile($("[name='remindphone']").val())){
		alert("请输入正确的手机号");
		return false;
	}

	var remindTime = $("#dated").datetimebox("getValue");
	if(remindTime==""){
		alert("请填写提醒时间");
		return false;
	}else if(new Date(remindTime.replace("-", "/").replace("-", "/")) < new Date()){
        alert("提醒时间只能大于当前时间 ");
        return false;
	}
	$w.httpRequest({
		url:apiroot+"/purchasetemp/remindsave",
		data:$("form").serializeArray(),
		ok:function(ret){
			window.location.href=ctx+"/purchasetemp/list";
		},all:function(){subing=false;}
	})
}

</script>